﻿
using Mono.Cecil;

public class StaticCallAstNode : CallAstTree
{
    public LuaTypeReference Type;

    public StaticCallAstNode(LuaTypeReference type, LuaMethodReference method, LuaAstTree[] parameters)
        : base(method, parameters)
    {
        Type = type;
    }
    public override void WriteTo(ICodeWriter writer)
    {
        if (Method.Name == "op_Equality")
        {
            Parameters[0].WriteTo(writer);
            writer.Code(" == ");
            Parameters[1].WriteTo(writer);
        }
        else
        {
            writer.Code($"{Type.FullName}.");
            base.WriteTo(writer);
        }
    }
}

